package com.pet.utils;

import com.pet.entity.UserDO;

public class UserContextUtil {
    private static final ThreadLocal<UserDO> userThreadLocal = new ThreadLocal<>();

    public static void addCurrentUser(UserDO user) {
        userThreadLocal.set(user);
    }

    public static UserDO getCurrentUser() {
        return userThreadLocal.get();
    }

    public static void remove() {
        userThreadLocal.remove();
    }
}
